﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register Src="../../../../_controltemplates/15/MII_FIF/Header.ascx" TagPrefix="UC" TagName="Header" %>
<%@ Register Src="../../../../_controltemplates/15/MII_FIF/LeftMenu.ascx" TagPrefix="UC" TagName="LeftMenu" %>
<%@ Register Src="../../../../_controltemplates/15/MII_FIF/Header.ascx" TagPrefix="UC" TagName="PageHeader" %>

<%@ Assembly Name="Microsoft.Web.CommandUI, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ViewCHVM.aspx.cs" Inherits="MII_FIF.Layouts.MII_FIF.Checklist.ViewCHVM" DynamicMasterPageFile="~masterurl/default.master" %>

<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">

</asp:Content>

<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
        <link href="../JQuery/jquery-ui-1.10.3.custom/css/ui-lightness/jquery-ui-1.10.3.custom.min.css" rel="stylesheet" />
    <script src="../JQuery/jquery-ui-1.10.3.custom/js/jquery-1.9.1.js" type="text/javascript"></script>
    <script src="../JQuery/jquery-ui-1.10.3.custom/js/jquery-ui-1.10.3.custom.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        function CheckTheCheckBoxes(dename) {
            var deid = "";
            var elem = document.forms[0].elements;
            for (var i = 0; i < elem.length; i++) {
                if (elem[i].name != null) {
                    if (elem[i].name.indexOf(dename) != -1) {
                        if (elem[i].disabled == false) {
                            elem[i].checked = document.getElementById('chkSelectAll').checked;
                        }
                    }
                }
            }
            return deid;
        }
    </script>

    <link href="../Style.css" rel="stylesheet" type="text/css" />
        <div>
            <table class="TableLuar">
            <tr>
                <td class="LeftMenu">
                    <UC:LeftMenu runat="server" id="LeftMenu" />
                </td>
                <td style="vertical-align: top;">
                    <table class="TableDalam">
                <tr>
                <td>
        <div style="text-align:center" runat="server" id="divstatus"><asp:Label ID="lblStatus" runat="server" ForeColor="Red"></asp:Label>
        <br />
        <br />
        </div>
        <asp:GridView ID="GridVM" runat="server" CellPadding="4" 
        EnableModelValidation="True" ForeColor="#333333" GridLines="None" 
        AutoGenerateColumns="False" AllowPaging="True" 
        onpageindexchanging="GridVM_PageIndexChanging"
        EmptyDataText="There is no Checklist for Virtual Machine" Font-Names="Arial" Width="100%" 
        AllowSorting="True" PageSize="10">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:TemplateField>
                <HeaderTemplate>
                    <input type="checkbox" name="chkSelectAll" id="chkSelectAll" onclick="CheckTheCheckBoxes('chk');" />
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:CheckBox runat="server" ID="chk" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="ID" HeaderStyle-CssClass="hidden" ItemStyle-CssClass="hidden"
                FooterStyle-CssClass="hidden" />
            <asp:BoundField DataField="VM" HeaderText="VM" >
            <ItemStyle Width="150px" />
            </asp:BoundField>
            <asp:BoundField DataField="Notes" HeaderText="Note" >
            <ItemStyle Width="100px" />
            </asp:BoundField>
            <asp:TemplateField>
            <ItemTemplate>
                <%# (String.IsNullOrEmpty(Eval("Attachment").ToString())) ? "No File" : String.Format("<a href='{0}'>Download</a>", Eval("Attachment")) %>
            </ItemTemplate>
                <HeaderTemplate>Attachment</HeaderTemplate>
            <ItemStyle Width="100px" />
        </asp:TemplateField>
            <asp:BoundField DataField="CHBy" HeaderText="Checklist By" >
            <ItemStyle Width="100px" />
            </asp:BoundField>
            <asp:BoundField DataField="CHDate" HeaderText="Checklist Date" DataFormatString="{0:dd-MMM-yyyy}" >
            <ItemStyle Width="100px" />
            </asp:BoundField>
            <asp:TemplateField HeaderText="Action">
            <ItemTemplate>
                <asp:Button Text="Show" runat="server" ID="btnEdit" CommandArgument='<%# Bind("ID") %>' CommandName="Edit" />
            </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" 
            HorizontalAlign="Center" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" 
            HorizontalAlign="Center" />
        <PagerSettings Mode="NextPreviousFirstLast" FirstPageText="First" 
            LastPageText="Last" NextPageText="Next" PreviousPageText="Previous" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Right" />
        <RowStyle BackColor="#EFF3FB" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        </asp:GridView>
                    <br />
                    <asp:Button runat="server" ID="btnAdd" Text="Add" />&nbsp;<asp:Button runat="server" ID="btnDelete" Text="Delete" />
        <br />
        <asp:Label ID="lblError" runat="server" ForeColor="Red"></asp:Label>  
                    </td>
                </tr>

                    </table>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>

<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
View CH VM
</asp:Content>

<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" >
View Checklist VM
</asp:Content>
